<template>
    <i :class="[props.icon, 'iconfont']" v-if="type==='font-class'"></i>
    <svg class="icon" aria-hidden="true" v-else>
        <use :xlink:href="`#${props.icon}`"></use>
    </svg>
</template>

<script lang="ts" setup>
const props = defineProps({
  icon: {
    type: String,
    required: true
  },
  type: {
    type: String,
    default: "font-class"
  }
})
</script>

<style lang="less" scoped>
i {
    margin-right: 4px;
    vertical-align: middle;
}
</style>
